/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beans;
import java.sql.*;
/**
 *
 * @author Miroslav Boskovic
 */
public class DB {
    public static Connection getConnection()
            throws SQLException {

        Connection con = null;
        String username = "root";
        String password = "";
        String driverClassName = "com.mysql.jdbc.Driver";
        String dburl = "jdbc:mysql://localhost:3306/lab_rezervacija";
        try {
            Class.forName(driverClassName);
            con=DriverManager.getConnection(dburl, username, password);
        } catch (ClassNotFoundException ex) {
            throw new SQLException(ex.getLocalizedMessage()+"ge");
            //pitanje za studente: cemu sluzi "ge"?
        }
        return con;
    }

}
